Fairlearn is a Python package that
you can use to analyze models and evaluate disparity between predictions and
prediction performance for one or more sensitive features. It works by calculating group metrics for
the sensitive features you specify. The metrics themselves are based on
standard psychic learn model evaluation metrics such as accuracy, precision or
recall for classification models. The Fairlearn API provides multiple ways
in detecting disparities in metrics across sensitive feature groupings. For a binary classification model,
you might start by comparing the selection rate, the number of
positive predictions for each group by using
the selection rate function. This function returns the overall
selection rate for the test data set. You can also use standard SK learned
metrics functions such as accuracy, score, precision score or recall score to get
an overall view of how the model performs. Then you can define one or
more sensitive features in your dataset with which you want to group
subsets of the population and compare selection rate and
predictive performance. Fairlearn includes a metric frame function
that enables you to create a data frame of multiple metrics by the group. For example, in a binary classification
model for loan repayment prediction, where the sensitive feature age consists
of two possible categorical values 25 and under and over 25. You can then create a metric frame for
these groups. It's often easier to
compare metrics visually. So Fairlearn provides an interactive
dashboard widget you can use in a notebook to display group metrics for a model. The widget enables you to choose
a sensitive feature and performance metric to compare and then calculates and
visualizes the metrics and disparity. Fairlearn integrates with Azure machine
learning by enabling you to run an experiment in which the dashboard
metrics are uploaded to your Azure machine learning workspace.